package com.note.util;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.nio.charset.StandardCharsets;

/**
 *  富文本转html 工具
 */
public class Text2HtmUtil {

    public static InputStream formToHtml(String data) {
        StringBuffer buf = new StringBuffer("");
        buf.append("<html>");
        buf
                .append("<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />");
        buf.append("<title>sdsds</title>");
        buf.append("<head>");
        buf.append("</head>");
        buf.append("<body>");
        buf.append(data);
        buf.append("</body>");
        buf.append("</html>");
        InputStream inputStream = new ByteArrayInputStream(buf.toString().getBytes(StandardCharsets.UTF_8));
        return inputStream;
    }
}
